.PHONY:all clean server run echo
vpath %.cpp src
vpath %.h include
INCLUDE_PATH:=include/
SRC_PATH:=src/
BUILD_PATH=build/
OBJ_PATH:=$(BUILD_PATH)obj/
SRC:=$(shell find $(SRC_PATH)*)
OBJ:=$(patsubst $(SRC_PATH)%.cpp,$(OBJ_PATH)%.o,$(SRC))


APP=sniffer

APP:=$(BUILD_PATH)$(APP)

CFLAGS = -I$(INCLUDE_PATH) -c -g -Wall -Werror

$(APP):$(OBJ)
	g++ -o $@ $^

$(OBJ):$(SRC) 
	g++ -o $@ $< $(CFLAGS)

run:$(APP)
	sudo -p zyl $(APP)

clean:
	rm -rf $(OBJ) $(APP)

echo:
	@echo $(OBJ)

